import request from "@/utils/request"

/**
 * @param current 当前页
 * @param limit 显示页数
 * @param queryInfo 查询条件
 * @returns {新闻列表}
 */
export const reqGetNewsList = (current, limit,queryInfo) => request({url: `/news/getNewsList/${current}/${limit}`, method: 'post',data:queryInfo})
/**
 *
 * @param newsId 新闻id
 * @returns {AxiosPromise}
 */
export const reqRemoveNewsById = (newsId) => request({url: `/news/${newsId}`,method:'delete'})

/**
 * 添加新闻
 * @param news 新闻对象
 * @returns {AxiosPromise}
 */
export const reqAddNews = (news) => request({url:`/news/addNews`,method:'post',data:news})
/**
 * 编辑新闻
 * @param news
 * @returns {AxiosPromise}
 */
export const reqEditNews = (news) => request({ url: `/news/editNews`, method: 'post', data: news })

/**
 * 根据id获取新闻
 * @param {*} newsId
 * @returns
 */
export const reqGetNewsById = (newsId) => request({url:`/news/getNewsById/${newsId}`,method:'get'})

/**
 * 批量删除新闻
 * @param ids
 * @returns {AxiosPromise}
 */
export const reqRemoveNewsArray = (ids) => request({url:`/news/removeArray`,method:'post',data:ids})
